package com.oceansoft.mobile.econsole.modules.apps.persistence;


import com.oceansoft.mobile.econsole.modules.apps.entity.AppDownload;
import com.oceansoft.mobile.econsole.modules.apps.entity.AppInfo;
import com.oceansoft.mobile.econsole.modules.apps.entity.AppInfoV2;
import com.oceansoft.mobile.econsole.modules.apps.entity.MenuItem;
import com.oceansoft.mobile.econsole.modules.base.entity.Query;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: Andy
 * @time: 2014-4-30 下午 13:43
 */
@Repository("appInfoMapper")
public interface IAppInfoMapper {

    public List<AppInfo> findAppsListByPage(Query query);
    public List<AppInfoV2> findAppsListByPageV2(Query query);
 

    public AppInfo findAppInfoById(@Param("id") int appId);

    /**
     * 根据ID加载应用基本信息
     *
     * @param appId 应用ID
     * @return AppInfo 基本信息
     */
    public AppInfo findAppBaseInfoById(@Param("id") int appId);

//    public List<MenuItem> findMenuGroupByAppId(@Param("id") int appId);

//    public List<MenuItem> findMenuItemByParentId(@Param("id") int menuGroupId);

    /**
     * 根据条件分页加载数据
     *
     * @param query 查询过滤条件
     * @return List<AppInfo>
     */
    public List<AppInfo> loadPageByCondition(Query query);

    public void deleteById(int appId);

    public int save(AppInfo appInfo);

    public void update(AppInfo appInfo);

    public List<AppInfo> findDefaultPlugins();
    
    
    
    public void insertAppDownload(AppDownload appdownload);
}
